package com.lace.security.jwt.controller;

import com.lace.security.jwt.LoginReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

import static com.lace.security.jwt.constant.SecurityConstant.DEFAULT_LOGIN_PROCESSING_URL_FORM;
/**
 * Created by WangZX on 2018/7/14.
 */
@RestController
public class AuthController {

	@Autowired
	private AuthService authService;
	
	@PostMapping(DEFAULT_LOGIN_PROCESSING_URL_FORM)
	public Map<String, String> login(@RequestBody LoginReq loginReq) {
		return authService.login(loginReq);
	}

}
